﻿using Business.BookManagement.Dto;
using Business.BookManagement;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp;
using Business.AssembleInfoManagement;
using Business.AssembleInfoManagement.Dto;
using Business.AssProManagement.Dto;
using Volo.Abp.Domain.Repositories;

namespace Business.Controllers
{
    [RemoteService]
    [Area("Business")]
    [Route("api/business/assembleInfo")]
    public class AssembleInfoController : AbpController
    {
        private readonly IAssembleInfoAppService _BookAppService;

        public AssembleInfoController(IAssembleInfoAppService BookAppService)
        {
            _BookAppService = BookAppService;
        }

        [HttpPost]
        [Route("data-post")]
        public Task<AssembleInfoDto> CreateOrUpdate(CreateOrUpdateAssembleInfoDto input)
        {
            return _BookAppService.CreateOrUpdate(input);
        }

        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _BookAppService.Delete(ids);
        }

        [HttpGet]
        [Route("{id}")]
        public Task<AssembleInfoDto> Get(Guid id)
        {
            return _BookAppService.Get(id);
        }

        [HttpGet]
        [Route("GetAssembleInfo")]
        public  Task<CreateOrUpdateAssembleInfoDto> GetAssembleInfo(string id)
        {
            return _BookAppService.GetAssembleInfo(id);
        }

        [HttpGet]
        public Task<PagedResultDto<AssembleInfoDto>> GetAll(GetAssembleInfoInputDto input, string dadname, string Assemblenumber)
        {
            return _BookAppService.GetAll(input, dadname, Assemblenumber);
        }
    }

}
